package com.herench.bunch.lab.handler;

import com.herench.bunch.commons.annotation.Handler;
import com.herench.bunch.commons.support.AbstractMessageHandler;
import com.herench.bunch.lab.agent.LabOperationAgent;
import com.herench.bunch.lab.convert.LabReportConvert;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
import java.util.Map;

/**
 * @author luoxiaoming on 18-10-16 下午1:13
 * @email luoxiaoming@herench.com
 */


@Handler(code = "900020", name = "检验报告返回", messageConvertClass = LabReportConvert.class)
public class LabReportHandler extends AbstractMessageHandler {

    @Autowired
    private LabOperationAgent labOperationAgent;

    @Override
    protected Object proxyInvoke(Object inMessage) throws Exception {
        List<Map<String, Object>> reportList = (List<Map<String, Object>>) inMessage;
        Map<String, Object> resMap = labOperationAgent.labResultReport(reportList);
        return resMap;
    }
}
